package office.action.hr.wrapper;

import java.util.Map;

import office.bo.hr.impl.RecruitPlan;
import platform.common.bo.IdentifiableObj;
import platform.util.Util;

/**
 * 招聘计划wrapper
 * @author ibmsz
 *
 */
public class RecruitPlanWrapper {
	private String id;
	private String userId;			//用户Id
	private String planName;		//计划名称
	private String pipeline;		//招聘渠道
	private double budgetFee;		//预算费用
	private String startDate;		//开始时间
	private String endDate;			//结束时间
	private int recruitPopulation;	//招聘人数
	private String recruitMemo;		//招聘说明
	private String recruitRemark;	//招聘备注
	
	private String recruitRequirementId;	//所属招聘需求
	private String checkUser;		//审批人
	private String checkUserName;
	private String state;			//审批状态(-1被驳回;0)
	private String stateName;
	private String checkRole;
	
	public RecruitPlanWrapper(){
		
	}
	@SuppressWarnings("unchecked")
	public RecruitPlanWrapper(String id,String planName,String pipeline,double budgetFee,
			String startDate,String endDate,int recruitPopulation,String recruitMemo,
			String recruitRemark,String checkUser,String state,String checkUserName,String userId,String checkRole){
		this.id = id;
		this.planName = planName;
		if(null!=pipeline && !("").equals(pipeline)){
			Map map = Util.parsePropertiesReturnMap("office","pipeline.size");
			if(map.containsKey(pipeline)){
				this.pipeline = (String)map.get(pipeline);
			}
		}
		this.budgetFee = budgetFee;
		this.startDate = startDate;
		this.endDate = endDate;
		this.recruitPopulation = recruitPopulation;
		this.recruitMemo = recruitMemo;
		this.recruitRemark = recruitRemark;
		this.checkUser = checkUser;
		this.checkUserName = checkUserName;
		this.state = state;
		this.checkRole = checkRole;
		if(null!=state && !("").equals(state)){
			if(state.equals("-1")){
				this.stateName = "审批驳回";
			}else if(state.equals("0")){
				this.stateName = "未提交审批";
			}else if(state.equals("1")){
				this.stateName = "审批过程";
			}else if(state.equals("100")){
				this.stateName="审批完成";
			}
		}
		this.userId = userId;
	}
	
	/**
	 * 从bo拷贝属性
	 * @param baseBO
	 */
	@SuppressWarnings("unchecked")
	public void copyToWrapper(IdentifiableObj baseBO,Map map){
		RecruitPlan bo = (RecruitPlan)baseBO;
		this.id = bo.getId().toString();
		this.planName = bo.getPlanName();
		if(null!=bo.getPipeline() && !("").equals(bo.getPipeline())){
			if(map.containsKey(bo.getPipeline())){
				this.pipeline = (String)map.get(bo.getPipeline());
			}
		}
		this.budgetFee = bo.getBudgetFee();
		this.startDate = bo.getStartDate();
		this.endDate = bo.getEndDate();
		this.recruitPopulation = bo.getRecruitPopulation();
		this.recruitMemo = bo.getRecruitMemo();
		this.recruitRemark = bo.getRecruitRemark();
		//this.recruitRequirementId = bo.getRecruitRequirementId();
		this.checkUser = bo.getCheckUser();
	}
	public String getId() {
		return id;
	}
	public void setId(String id) {
		this.id = id;
	}
	public String getPlanName() {
		return planName;
	}
	public void setPlanName(String planName) {
		this.planName = planName;
	}
	public String getPipeline() {
		return pipeline;
	}
	public void setPipeline(String pipeline) {
		this.pipeline = pipeline;
	}
	public double getBudgetFee() {
		return budgetFee;
	}
	public void setBudgetFee(double budgetFee) {
		this.budgetFee = budgetFee;
	}
	public String getStartDate() {
		return startDate;
	}
	public void setStartDate(String startDate) {
		this.startDate = startDate;
	}
	public String getEndDate() {
		return endDate;
	}
	public void setEndDate(String endDate) {
		this.endDate = endDate;
	}
	public int getRecruitPopulation() {
		return recruitPopulation;
	}
	public void setRecruitPopulation(int recruitPopulation) {
		this.recruitPopulation = recruitPopulation;
	}
	public String getRecruitMemo() {
		return recruitMemo;
	}
	public void setRecruitMemo(String recruitMemo) {
		this.recruitMemo = recruitMemo;
	}
	public String getRecruitRemark() {
		return recruitRemark;
	}
	public void setRecruitRemark(String recruitRemark) {
		this.recruitRemark = recruitRemark;
	}
	public String getRecruitRequirementId() {
		return recruitRequirementId;
	}
	public void setRecruitRequirementId(String recruitRequirementId) {
		this.recruitRequirementId = recruitRequirementId;
	}
	public String getCheckUser() {
		return checkUser;
	}
	public void setCheckUser(String checkUser) {
		this.checkUser = checkUser;
	}

	public String getCheckUserName() {
		return checkUserName;
	}

	public void setCheckUserName(String checkUserName) {
		this.checkUserName = checkUserName;
	}

	public String getState() {
		return state;
	}

	public void setState(String state) {
		this.state = state;
	}

	public String getStateName() {
		return stateName;
	}

	public void setStateName(String stateName) {
		this.stateName = stateName;
	}

	public String getUserId() {
		return userId;
	}

	public void setUserId(String userId) {
		this.userId = userId;
	}

	public String getCheckRole() {
		return checkRole;
	}

	public void setCheckRole(String checkRole) {
		this.checkRole = checkRole;
	}

	
}
